<?php
    if( isset( $errorsModel ) && $errorsModel instanceof ErrorsModelVO )
    {
        $manager = new ErrorsModelManager( $errorsModel );
    }
    if( isset( $result ) ) $result instanceof RoleVO;
?>
<div id="title_bloc" class="app_contents">
    <h1>Gestion des Roles de l'application <strong>: ROLES</strong></h1>
</div>

<div id="description_bloc">
    Formulaire d'édition d'un role.
</div>

<?php $this->config->includePartial( BackendModulesList::MAIN, 'flashes', array( 'flashes' => $flashes ) ) ;?>

<form action="<?php echo UriHelper::get(BackendModulesList::ROLES, 'edit' ) ;?>" method="post" >
    <?php echo HtmlHelper::hidden( 'id', $result->id ); ?>
    <label for="label">Label</label><?php echo HtmlHelper::inputText( RoleModel::LABEL_FIELD, array( 'id' => 'label', 'value' => $result->label ) ) ; ?><br />
    <?php if( isset( $manager ) && $manager->hasError( RoleModel::LABEL_FIELD ) ): ?><?php echo HtmlHelper::errorForm( $manager->getError( RoleModel::LABEL_FIELD )->message ); ?><br /><?php endif; ?>

    <label for="rank">Rank</label><?php echo HtmlHelper::inputText( RoleModel::RANK_FIELD, array( 'id' => 'rank', 'value' => $result->rank ) ) ; ?><br />
    <?php if( isset( $manager ) && $manager->hasError( RoleModel::RANK_FIELD ) ): ?><?php echo HtmlHelper::errorForm( $manager->getError( RoleModel::RANK_FIELD )->message ); ?><br /><?php endif; ?>

    <label for="slug">Slug</label><?php echo HtmlHelper::inputText( RoleModel::SLUG_FIELD, array( 'id' => 'slug', 'value' => $result->slug ) ) ; ?><br />
    <?php if( isset( $manager ) && $manager->hasError( RoleModel::SLUG_FIELD ) ): ?><?php echo HtmlHelper::errorForm( $manager->getError( RoleModel::SLUG_FIELD )->message ); ?><br /><?php endif; ?>

    <span class="submit"><?php echo HtmlHelper::submit( array( 'name' => 'submit', 'value' => 'Mettre à jour le rôle' ) ) ; ?></span>
</form>